package com.repeat.member.mq.consump;

import com.repeat.member.config.DirectConfig;
import org.springframework.amqp.rabbit.annotation.Exchange;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.QueueBinding;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class DirectConsump{
    @RabbitListener(bindings = @QueueBinding(
            value = @Queue(name = DirectConfig.DIRECT_QUEUE1),
            exchange = @Exchange(name = DirectConfig.DIRECT_EXCHANGE),
            key = {DirectConfig.DIRECT_ROUTING_KEY_RED,DirectConfig.DIRECT_ROUTING_KEY_BLACK}
    ))
    public void DirectExchange(String consump) {
        System.out.println("directREDAndBlack消息"+consump);
    }
    @RabbitListener(bindings = @QueueBinding(
            value = @Queue(name = DirectConfig.DIRECT_QUEUE2),
            exchange = @Exchange(name = DirectConfig.DIRECT_EXCHANGE),
            key = {DirectConfig.DIRECT_ROUTING_KEY_RED,DirectConfig.DIRECT_ROUTING_KEY_WHITE}
    ))
    public void DirectExchange2(String consump) {
        System.out.println("directRedAndWhite消息"+consump);
    }
}
